3.2.24 \(\int \frac {x^{-1+n} (b+2 c x^n)}{b x^n+c x^{2 n}} \, dx\) [124]

Optimal. Leaf size=15 \[ \log (x)+\frac {\log \left (b+c x^n\right )}{n} \]

[Out]

ln(x)+ln(b+c*x^n)/n

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 15, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 3, integrand size = 29, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.103, Rules used = {1598, 457, 78} \begin {gather*} \frac {\log \left (b+c x^n\right )}{n}+\log (x) \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(x^(-1 + n)*(b + 2*c*x^n))/(b*x^n + c*x^(2*n)),x]

[Out]

Log[x] + Log[b + c*x^n]/n

Rule 78

Int[((a_.) + (b_.)*(x_))*((c_) + (d_.)*(x_))^(n_.)*((e_.) + (f_.)*(x_))^(p_.), x_Symbol] :> Int[ExpandIntegran
d[(a + b*x)*(c + d*x)^n*(e + f*x)^p, x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && ((ILtQ[
n, 0] && ILtQ[p, 0]) || EqQ[p, 1] || (IGtQ[p, 0] && ( !IntegerQ[n] || LeQ[9*p + 5*(n + 2), 0] || GeQ[n + p + 1
, 0] || (GeQ[n + p + 2, 0] && RationalQ[a, b, c, d, e, f]))))

Rule 457

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 1598

Int[(u_.)*(x_)^(m_.)*((a_.)*(x_)^(p_.) + (b_.)*(x_)^(q_.))^(n_.), x_Symbol] :> Int[u*x^(m + n*p)*(a + b*x^(q -
 p))^n, x] /; FreeQ[{a, b, m, p, q}, x] && IntegerQ[n] && PosQ[q - p]

Rubi steps

\begin {align*} \int \frac {x^{-1+n} \left (b+2 c x^n\right )}{b x^n+c x^{2 n}} \, dx &=\int \frac {b+2 c x^n}{x \left (b+c x^n\right )} \, dx\\ &=\frac {\text {Subst}\left (\int \frac {b+2 c x}{x (b+c x)} \, dx,x,x^n\right )}{n}\\ &=\frac {\text {Subst}\left (\int \left (\frac {1}{x}+\frac {c}{b+c x}\right ) \, dx,x,x^n\right )}{n}\\ &=\log (x)+\frac {\log \left (b+c x^n\right )}{n}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 19, normalized size = 1.27 \begin {gather*} \frac {\log \left (x^n\right )+\log \left (n \left (b+c x^n\right )\right )}{n} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(x^(-1 + n)*(b + 2*c*x^n))/(b*x^n + c*x^(2*n)),x]

[Out]

(Log[x^n] + Log[n*(b + c*x^n)])/n

________________________________________________________________________________________

Maple [A]
time = 0.24, size = 18, normalized size = 1.20

method result size
norman \(\ln \left (x \right )+\frac {\ln \left (c \,{\mathrm e}^{n \ln \left (x \right )}+b \right )}{n}\) \(18\)
risch \(\ln \left (x \right )+\frac {\ln \left (x^{n}+\frac {b}{c}\right )}{n}\) \(18\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(x^(-1+n)*(b+2*c*x^n)/(b*x^n+c*x^(2*n)),x,method=_RETURNVERBOSE)

[Out]

ln(x)+1/n*ln(c*exp(n*ln(x))+b)

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 47 vs. \(2 (15) = 30\).
time = 0.29, size = 47, normalized size = 3.13 \begin {gather*} b {\left (\frac {\log \left (x\right )}{b} - \frac {\log \left (\frac {c x^{n} + b}{c}\right )}{b n}\right )} + \frac {2 \, \log \left (\frac {c x^{n} + b}{c}\right )}{n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1+n)*(b+2*c*x^n)/(b*x^n+c*x^(2*n)),x, algorithm="maxima")

[Out]

b*(log(x)/b - log((c*x^n + b)/c)/(b*n)) + 2*log((c*x^n + b)/c)/n

________________________________________________________________________________________

Fricas [A]
time = 0.35, size = 17, normalized size = 1.13 \begin {gather*} \frac {n \log \left (x\right ) + \log \left (c x^{n} + b\right )}{n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1+n)*(b+2*c*x^n)/(b*x^n+c*x^(2*n)),x, algorithm="fricas")

[Out]

(n*log(x) + log(c*x^n + b))/n

________________________________________________________________________________________

Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 54 vs. \(2 (12) = 24\).
time = 6.88, size = 54, normalized size = 3.60 \begin {gather*} \begin {cases} \log {\left (x \right )} & \text {for}\: c = 0 \wedge n = 0 \\\frac {\left (b + 2 c\right ) \log {\left (x \right )}}{b + c} & \text {for}\: n = 0 \\- \frac {n \log {\left (x^{- n} \right )}}{n^{2} - n} + \frac {\log {\left (x^{- n} \right )}}{n^{2} - n} & \text {for}\: c = 0 \\\frac {\log {\left (x^{n} \right )}}{n} + \frac {\log {\left (\frac {b}{c} + x^{n} \right )}}{n} & \text {otherwise} \end {cases} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x**(-1+n)*(b+2*c*x**n)/(b*x**n+c*x**(2*n)),x)

[Out]

Piecewise((log(x), Eq(c, 0) & Eq(n, 0)), ((b + 2*c)*log(x)/(b + c), Eq(n, 0)), (-n*log(x**(-n))/(n**2 - n) + l
og(x**(-n))/(n**2 - n), Eq(c, 0)), (log(x**n)/n + log(b/c + x**n)/n, True))

________________________________________________________________________________________

Giac [A]
time = 5.58, size = 17, normalized size = 1.13 \begin {gather*} \frac {\log \left ({\left | c x^{n} + b \right |}\right )}{n} + \log \left ({\left | x \right |}\right ) \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(x^(-1+n)*(b+2*c*x^n)/(b*x^n+c*x^(2*n)),x, algorithm="giac")

[Out]

log(abs(c*x^n + b))/n + log(abs(x))

________________________________________________________________________________________

Mupad [B]
time = 2.23, size = 28, normalized size = 1.87 \begin {gather*} \frac {2\,\left (\ln \left (b+c\,x^n\right )-\mathrm {atanh}\left (\frac {2\,c\,x^n}{b}+1\right )\right )}{n} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((x^(n - 1)*(b + 2*c*x^n))/(b*x^n + c*x^(2*n)),x)

[Out]

(2*(log(b + c*x^n) - atanh((2*c*x^n)/b + 1)))/n

________________________________________________________________________________________